﻿#include "posview.h"
#include "ui_posview.h"

PosView* PosView::_posv=nullptr;

PosView::PosView(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::PosView)
{
    ui->setupUi(this);
}

PosView::~PosView()
{
    delete ui;
}

PosView *PosView::Instance()
{
    if(PosView::_posv==nullptr)
    {
        _posv=new PosView();
    }
    return _posv;
}

void PosView::setValues(std::vector<double> pos)
{
    if(pos.size()<6)
        return;
    ui->doubleSpinBox_pos_1->setValue(pos.at(0));
    ui->doubleSpinBox_pos_2->setValue(pos.at(1));
    ui->doubleSpinBox_pos_3->setValue(pos.at(2));
    ui->doubleSpinBox_pos_4->setValue(pos.at(3));
    ui->doubleSpinBox_pos_5->setValue(pos.at(4));
    ui->doubleSpinBox_pos_6->setValue(pos.at(5));
}
